package com.lysj.bhp.customer.controller;

import com.lysj.bhp.borrowing.domain.BorrowingInstallment;
import com.lysj.bhp.customer.base.CustomerContent;
import com.lysj.bhp.customer.vo.OverdueInstallmentVo;
import com.lysj.bhp.customer.vo.OverdueListVo;
import com.lysj.bhp.util.web.Resp;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * @Author: ZhangWenJian
 * @Create: 2018/9/10--15:28
 * @Description:逾期名单控制类
 */
@RestController
@RequestMapping("admin/overdue_list")
public class OverdueListController extends CustomerContent {

    @GetMapping("/list")
    public Resp list() {
        List<OverdueListVo> overdueListVos = borrowingInstallmentRepository.findOverdueListRecord(new Date());
        return new Resp(overdueListVos);
    }
    @GetMapping("/find_overdue_installment")
    public Resp findOverdueInstallment(Long userId){
        List<OverdueInstallmentVo> overdueInstallmentVo = borrowingInstallmentRepository.findOverdueInstallmentVo(userId,new Date());
        return new Resp(overdueInstallmentVo);
    }


}
